Crate barter_integration
source ·Expand description
Barter-Integration
High-performance, low-level framework for composing flexible web integrations.
Utilised by other Barter trading ecosystem crates to build robust financial exchange integrations, primarily for public data collection & trade execution. It is:
- Low-Level: Translates raw data streams communicated over the web into any desired data model using arbitrary data transformations.
- Flexible: Compatible with any protocol (WebSocket, FIX, Http, etc.), any input/output model, and any user defined transformations.
Core abstractions:
- RestClient providing configurable signed Http communication between client & server.
- ExchangeStream providing configurable communication over any asynchronous stream protocols (WebSocket, FIX, etc.).
Both core abstractions provide the robust glue you need to conveniently translate between server & client data models.
Modules
- Utilities to assist deserialisation.
- All
Error
s generated in Barter-Integration. - Contains the flexible
Metric
type used for representing real-time metrics generically. - Foundational data structures that define the building blocks used by the rest of the
Barter
ecosystem. - Contains
StreamParser
implementations for transforming communication protocol specific messages into a generic output data structure.
Structs
- An
ExchangeStream
is a communication protocol agnostic [Stream
]. It polls protocol messages from the inner [Stream
], and transforms them into the desired output data structure.
Traits
Transformer
s are capable of transforming anyInput
into an iterator ofResult<Self::Output, Self::Error>
s.Validator
s are capable of determining if their internal state is satisfactory to fulfill some use case defined by the implementor.